name: pre-commit run_id: commands[0] env HOME: /home/jenkins env LANG: C.UTF-8 env PATH: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit/bin:/opt/pyenv/bin:/tmp/venv-f47V/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/opt/sdkman/candidates/mvnd/current/bin:/opt/sdkman/candidates/maven/current/bin:/opt/sdkman/candidates/java/current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin env PIP_DISABLE_PIP_VERSION_CHECK: 1 env PIP_USER: 0 env PYTHONHASHSEED: 458897099 env PYTHONIOENCODING: utf-8 env SSH_AUTH_SOCK: ******************************** env TOX_ENV_DIR: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit env TOX_ENV_NAME: pre-commit env TOX_WORK_DIR: /w/workspace/integration-test-tox-verify-master/.tox env VIRTUAL_ENV: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit env __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI: true metadata pid: 2585 cwd: /w/workspace/integration-test-tox-verify-master allow: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit/bin/* cmd: pre-commit run --all-files --show-diff-on-failure exit_code: 1 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. [INFO] Initializing environment for https://github.com/PyCQA/flake8. [INFO] Initializing environment for https://github.com/psf/black. [INFO] Initializing environment for https://github.com/MarketSquare/robotframework-tidy. [INFO] Initializing environment for https://github.com/MarketSquare/robotframework-tidy:robotframework==6.1.1. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. [INFO] Initializing environment for local:rstcheck,sphinx. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/PyCQA/flake8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/psf/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/MarketSquare/robotframework-tidy. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for local. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... trim trailing whitespace.................................................Passed flake8...................................................................Failed - hook id: flake8 - exit code: 1 tools/fastbgp/play2.py:2747:28: W292 no newline at end of file threaded_job(arguments) ^ black....................................................................Failed - hook id: black - files were modified by this hook reformatted tools/fastbgp/play2.py All done! ✨ 🍰 ✨ 1 file reformatted, 105 files left unchanged. robotidy.................................................................Passed rstcheck.................................................................Passed pre-commit hook(s) made changes. If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`. To run `pre-commit` as part of git workflow, use `pre-commit install`. All changes made by hooks: diff --git a/tools/fastbgp/play2.py b/tools/fastbgp/play2.py index ca7dfd28..60a23a67 100755 --- a/tools/fastbgp/play2.py +++ b/tools/fastbgp/play2.py @@ -179,7 +179,9 @@ def parse_arguments(): str_help = "Link-State NLRI supported" parser.add_argument("--bgpls", default=False, type=bool, help=str_help) str_help = "Link-State NLRI: Identifier" - parser.add_argument("-lsid", "--lsid", dest="lsid", default=1, type=int, help=str_help) + parser.add_argument( + "-lsid", "--lsid", dest="lsid", default=1, type=int, help=str_help + ) str_help = "Link-State NLRI: Policy Color" parser.add_argument( "--color", "-lstid", dest="color", default=100, type=int, help=str_help @@ -835,12 +837,8 @@ class MessageGenerator(object): Returns: :return: dictionary of LS NLRI parameters and values """ - identifier = self.ls_nlri_default["Identifier"] + int( - index / self.lsid_step - ) - color = self.ls_nlri_default["Color"] + int( - index / self.color_step - ) + identifier = self.ls_nlri_default["Identifier"] + int(index / self.lsid_step) + color = self.ls_nlri_default["Color"] + int(index / self.color_step) discriminator = self.ls_nlri_default["Discriminator"] + int( index / self.discriminator_step ) @@ -1492,14 +1490,22 @@ class MessageGenerator(object): # SR Policy Candidate Path Descriptor TLV (TLV 554) - RFC 9857 Section 4 tlv_554_val = ( - struct.pack("B", int(ls_nlri["ProtocolOrigin"])) # 1 octet: Protocol-Origin + struct.pack( + "B", int(ls_nlri["ProtocolOrigin"]) + ) # 1 octet: Protocol-Origin + b"\x00" # 1 octet: Flags (E=0, O=0 for IPv4) + b"\x00\x00" # 2 octets: Reserved + struct.pack(">I", int(ls_nlri["Endpoint"])) # 4 octets: Endpoint + struct.pack(">I", int(ls_nlri["Color"])) # 4 octets: Policy Color - + struct.pack(">I", int(ls_nlri["OriginatorASN"])) # 4 octets: Originator ASN - + struct.pack(">I", int(ls_nlri["OriginatorAddress"])) # 4 octets: Originator Address - + struct.pack(">I", int(ls_nlri["Discriminator"])) # 4 octets: Discriminator + + struct.pack( + ">I", int(ls_nlri["OriginatorASN"]) + ) # 4 octets: Originator ASN + + struct.pack( + ">I", int(ls_nlri["OriginatorAddress"]) + ) # 4 octets: Originator Address + + struct.pack( + ">I", int(ls_nlri["Discriminator"]) + ) # 4 octets: Discriminator ) tlv_554 = struct.pack(">HH", 554, len(tlv_554_val)) + tlv_554_val @@ -2744,4 +2750,4 @@ def threaded_job(arguments): if __name__ == "__main__": arguments = parse_arguments() logger = create_logger(arguments.loglevel, arguments.logfile) - threaded_job(arguments) \ No newline at end of file + threaded_job(arguments)